<?php
	defined('_JEXEC') or die('Restricted access');
	require_once(CUTEENGINE_BASE_COMPONENTS_PATH."base_display_component_class.php");	
	require_once(CUTEENGINE_NAMESPACES_PATH."javascript_namespace.php");
	//
	// t_content_loader
	// content loader object for cross-browser requests
	//
	class t_content_loader_result
    {
		//property
		//private        
        // R
        private $functions_result_array = array();

        
		//property
		//public        
		// E
		public $error_msg = '';
        // N
        const name = 'json_result';    
		// Q
		const query = null;
        // S
        public $succeeded = false;
        
		//methods
		//public        
        public function __construct() 
		{
		}
        // A
        public function add_function_result($a_function_obj,$a_function_name,$a_arguments,$a_function_body)
        {
            $this->functions_result_array[] = array('function_obj' => $a_function_obj,'function_name' => $a_function_name, 'arguments' => $a_arguments, 'function_body' => $a_function_body);
			//print_r($this->functions_result_array);
        }
        // G
        public function get_json_string()
        {
            $local_functions_result_array = '';
            if ($this->succeeded)
                $local_succeeded = 'true';
            else    
                $local_succeeded = 'false';
                
            foreach ($this->functions_result_array as $local_index => $local_function)
            {
                if ($local_functions_result_array != '')
                    $local_functions_result_array .= ",{function_obj:\"".$local_function['function_obj']."\",function_name:\"".$local_function['function_name']."\", arguments:\"".addslashes($local_function['arguments'])."\", function_body:\"".addslashes($local_function['function_body'])."\"}";
                else
                    $local_functions_result_array .= "{function_obj:\"".$local_function['function_obj']."\",function_name:\"".$local_function['function_name']."\", arguments:\"".addslashes($local_function['arguments'])."\", function_body:\"".addslashes($local_function['function_body'])."\"}";
            }
			
            echo str_replace("\r\n", "\n","{succeeded:$local_succeeded,error_msg:\"".addslashes($this->error_msg)."\",functions_result_array:[$local_functions_result_array]}");
        }
        public static function get_match_json_string()
        {
            return "[{]succeeded[\S\s]*[}]";
            //return "'[\s\S]*[{]succeeded[\s\S]*[}]'";
        }
        
    }
	
    class t_content_loader
	{
		// constant
		// E
		const end_result_tag = ')';
		// S
		const start_result_tag = '(';
		//property
		//private
		// J
		private $javascript_namespace = null;
        //public
		// C
        public $component_to_log = '';
		public $component_to_write_response_name = '';
		// O
		public $onprogressing = '';
		public $onerror = '';
		public $onload = '';
		public $onstartload = '';
		// P 
        public $parent_component = null;
        // U
		public $use_disguised_parameters_string = false; 
        
		// method
		// private
		// C
		private function create_javascript_initialization_component()
		{   
			
			//
			$this->javascript_namespace->header_script_generator->add_class(
				get_class($this).'_request_cmd','a_cmd,a_req_index',
				t_base_display_component::base_javascript_component_name());
			// property
			$this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this).'_request_cmd','cmd','a_cmd');
			$this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this).'_request_cmd','req_index','a_req_index');
			//	
			$this->javascript_namespace->header_script_generator->add_class(
				get_class($this),'',t_base_display_component::base_javascript_component_name());
			// property
			// A
			$this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this),'as_new_title','false');
			$this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this),'async','undefined');
				
			// C
   			$this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this),'CMD_REQ_RELOAD','1');
            $this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this),'cmd_request','new Array ()');
			$this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this),'component_to_log','undefined');
            $this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this),'component_to_response','undefined');    
			$this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this),'content_type',"''");	
            $this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this),'current_request_index',"-1");	                
            $this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this),'last_request_index_executed',"-1");	                
    
			$this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this),'custom_on__error',"undefined");
			$this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this),'custom_on__load',"undefined");
			$this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this),'custom_on__start_load',"undefined");
			$this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this),'custom_on__progres',"undefined");
               
                
			// M
			$this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this),'method','undefined');
			// O
			$this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this),'owner','undefined');
			// R	
			$this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this),'READY_STATE_UNINITIALIZED','0');
			$this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this),'READY_STATE_LOADING','1');
			$this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this),'READY_STATE_LOADED','2');
			$this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this),'READY_STATE_INTERACTIVE','3');
			$this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this),'READY_STATE_COMPLETE','4');
            $this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this),'request_list','new Array ()');
			// U
			$this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this),'url',"''");
			// JAVASCRIPT METHOD
            //A
            $this->javascript_namespace->header_script_generator->add_method_to_a_class_with_content(
                get_class($this),'add_cmd_request','a_cmd,a_request_index',"
		var local_cmd = new ".get_class($this)."_request_cmd_class(a_cmd,a_request_index);	
		this.cmd_request.push(local_cmd);");
            $this->javascript_namespace->header_script_generator->add_method_to_a_class_with_content(
                get_class($this),'add_new_request','a_params,a_source_tag_name',"
        var local_req = false;
		//document.cookie = 'PHPSESSID=; expires=Thu, 01 Jan 1970 00:00:00 GMT;';
		//document.cookie = 'PHPSESSID_EVENT='+".t_cuteengine::javascript_instance_name.".current_session + ';';
		if (window.XMLHttpRequest){
			local_req=new XMLHttpRequest();
		} else if (window.ActiveXObject){
			local_req=new ActiveXObject('MSXML2.XMLHTTP.3.0');
		}
        
		if (local_req)
		{
            this.current_request_index += 1;
            local_req.request_index = this.current_request_index;
            local_req.content_loader = this;
			local_req.loading = false;
			local_req.params = a_params;
            local_req.source_tag_name = a_source_tag_name;
			this.request_list[local_req.request_index] = local_req;
		}	
		return local_req;");
            
			// C
			$this->javascript_namespace->header_script_generator->add_method_to_a_class_with_content(
				get_class($this),"compute_end_tag","a_tag","
		return '" . self::start_result_tag . "/' + a_tag + '".self::end_result_tag."';");
			$this->javascript_namespace->header_script_generator->add_method_to_a_class_with_content(
				get_class($this),"compute_start_tag","a_tag","
		return '".self::start_result_tag."' + a_tag + '".self::end_result_tag."';");
			// E
			$this->javascript_namespace->header_script_generator->add_method_to_a_class_with_content(
				get_class($this),"extract_result_tag_value","a_tag","
		var local_start = this.compute_start_tag(a_tag);
		var local_end = this.compute_end_tag(a_tag);
		var local_return = this.response_text.substring(this.response_text.indexOf(local_start) + local_start.length,this.response_text.indexOf(local_end));
		this.response_text = this.response_text.replace(local_start+local_return+local_end,'');
		return local_return;");
			// J
			$this->javascript_namespace->header_script_generator->add_method_to_a_class_with_content(
				get_class($this),"json_result_match","a_source_string","
		var re = /".t_content_loader_result::get_match_json_string()."/ig;
		return a_source_string.match(re);");
		
			// D
			$this->javascript_namespace->header_script_generator->add_method_to_a_class_with_content(
				get_class($this),"on_error","a_req_index","
		try
        {
			if (this.request_list == undefined)
                var local_req = this;
            else  
                var local_req = this.request_list[a_req_index];
			/**/
			if (this.custom_on__error != undefined)
            {
                this.custom_on__error(a_req_index);
            }  
            else            
            {
				this.add_cmd_request(this.CMD_REQ_RELOAD,local_req.request_index);
                if (this.exception_error != undefined)
				{
					if (this.owner != ".t_cuteengine::javascript_instance_name.")
						".t_cuteengine::javascript_instance_name.".add_err_log(this.exception_error);
				}
				else
				{ 
					local_error = \"error fetching data!\"+
						\"\\n\\nreadyState:\"+local_req.readyState+
						\"\\nstatus: \"+local_req.status+
						\"\\nheaders: \"+local_req.getAllResponseHeaders();
					
				}
                
			}	
        }
        catch(e)
        {
            if (this.owner != ".t_cuteengine::javascript_instance_name.")
				".t_cuteengine::javascript_instance_name.".add_err_log(e);
        }
        this.start_loading(false,local_req);
        ");
			//	
			$this->javascript_namespace->header_script_generator->add_method_to_a_class_with_content(
				get_class($this),"on_start_load","a_req","
		try
		{
			if (this.custom_on__start_load != undefined)
            {
                this.custom_on__start_load(a_req);
            }  
            else            
            {
				if (this.component_to_log)
				{
					this.component_to_log.innerHTML = '';
				}
			}	
		}	
		catch(e)
		{
			if (this.owner != ".t_cuteengine::javascript_instance_name.")
				".t_cuteengine::javascript_instance_name.".add_err_log(e);
		}");			
			$this->javascript_namespace->header_script_generator->add_property_to_a_class(
				get_class($this),'onstartload','this.on_start_load');
			//	
			$this->javascript_namespace->header_script_generator->add_method_to_a_class_with_content(
				get_class($this),"on_load","a_req","
		
		try
		{	
			var local_last_request_index_executed = this.last_request_index_executed;
            if (a_req.request_index > this.last_request_index_executed)
                this.last_request_index_executed = a_req.request_index;
            if (this.custom_on__load != undefined)
            {
                this.custom_on__load(a_req,local_last_request_index_executed);
            }  
            else            
            {
                if (a_req.request_index > local_last_request_index_executed)
                {
                    
					var local_json_result_str = this.json_result_match(a_req.responseText);
                    this.response_text = a_req.responseText.replace(local_json_result_str,'');
					var local_to_log = '';
					if ((local_json_result_str != null) && (local_json_result_str.length > 0) &&(local_json_result_str[0] != ''))
					{
						var local_eval_str = '(' +local_json_result_str[0].replace(/\\n/g,'\\\\n')+')';//{[^\\\\]} 
                        var local_json_result_obj = eval(local_eval_str.replace(/\\n/g,'\\\\n'));
                      //  var local_json_result_obj = eval('(' +local_json_result_str[0].replace(/{\\n/g,'\\\\n')+')');
						
						local_to_log = local_json_result_obj.error_msg;
                          
                        for(var i = 0; i<local_json_result_obj.functions_result_array.length; i++) 
                        {
                            var local_function_obj = local_json_result_obj.functions_result_array[i].function_obj;
                            var local_function_name = local_json_result_obj.functions_result_array[i].function_name;
                            var local_arguments = local_json_result_obj.functions_result_array[i].arguments.replace(/\\n/g,'\\\\n');
                            var local_function_body = local_json_result_obj.functions_result_array[i].function_body.replace(/\\n/g,'\\\\n');
                            
                            if (local_function_obj != '')
                            {
                                if (local_function_body != '')
                                {
                                    if (local_function_name == '')
                                    {
                                        eval(local_function_obj+\".temp_function = new Function ('\"+local_arguments.addslashes()+\"','\"+local_function_body.addslashes()+\"')\");
                                        eval(local_function_obj+\".temp_function()\");
                                    }    
                                    else
                                    {
                                        local_function_obj.local_function_name = new Function (local_arguments,local_function_body);
                                        local_function_obj.local_function_name();
                                    }
                                }
                                else
                                {
                                    eval(local_function_obj +'.'+ local_function_name +'('+local_arguments+')' );
                                }
                            }
                            else if ((local_function_name == '') && (local_function_body != ''))
                            {
                                    var local_function = new Function ('',local_function_body.replace(/\\\\n/g,' '));
                                    local_function(local_arguments);
                            }
                            else
                            {
                                eval(local_function_name +'('+local_arguments+')' );
                            }
                        }    
                        
					}
					if (this.as_new_title === true)
                    {
                        var local_title = this.extract_result_tag_value('title');
                        document.title = local_title;
                    }
                    if (typeof this.component_to_response == 'object')
                    {
                        if (this.component_to_response.tagName == 'INPUT') 
							this.component_to_response.value = this.response_text;
						else	
							this.component_to_response.innerHTML = this.response_text;
                    }
					else if ((this.component_to_response != 'undefined') && (this.component_to_response != ''))
					{
						this.component_to_response(this.response_text);
					}
                    if ((this.component_to_log) &&(local_to_log != ''))
                    {
                        this.component_to_log.innerHTML = local_to_log;
                    }
                }    
            }
            this.request_list[a_req.request_index] = undefined;
            
		}	
		catch(e)
		{
			if (this.owner != ".t_cuteengine::javascript_instance_name.")
				".t_cuteengine::javascript_instance_name.".add_err_log(e);
		}
        this.start_loading(false,a_req);");	
			//$this->javascript_namespace->header_script_generator->add_property_to_a_class(
				//get_class($this),'onload','this.default_onload');
    
    
			$this->javascript_namespace->header_script_generator->add_method_to_a_class_with_content(
				get_class($this),"on_progres","a_req","
		try
		{
			
			this.response_text = a_req.responseText;
			if (this.custom_on__progres != undefined)
            {
                this.custom_on__progres();
            }  
            else            
            {
				if (this.component_to_log)
				{
					//this.component_to_log.innerHTML = local_resp;
				}
			}	
		}	
		catch(e)
		{
			if (this.owner != ".t_cuteengine::javascript_instance_name.")
				".t_cuteengine::javascript_instance_name.".add_err_log(e);
		}");
            
			// G
			$this->javascript_namespace->header_script_generator->add_method_to_a_class_with_content(
				get_class($this),"get_str","obj","
		var objId = obj.id;
		f = '<div id=content_loader_\"' + objId + '\" Style=\"width:100%; height:100%;\">';
		f += '</div>';
		return f;");

			//  I  //
			$this->javascript_namespace->header_script_generator->add_method_to_a_class_with_content(
				get_class($this),"initialize","a_owner,url,params,
	  component_to_log,a_to_write_response_name,
	  onprogressing,onload,onerror,async,a_method,content_type,onstartload,a_as_new_title","
		
		this.owner = a_owner;

		this.url = url;
		this.as_new_title = a_as_new_title;
		
		this.async = async;
		
		this.params = params;
		this.content_type = content_type;
		this.component_to_log = this.html_tag(component_to_log);
		var local_component_to_response = this.html_tag(a_to_write_response_name);
        if ((typeof local_component_to_response == 'object') && (local_component_to_response != null))
            this.component_to_response = local_component_to_response;
        else    
            this.component_to_response = new Function ('a_response_text',a_to_write_response_name);
		this.method = a_method;
		/* event */
		this.custom_on__error = onerror;
        this.custom_on__start_load = onstartload;
        this.custom_on__load = onload;
		this.custom_on__progres = onprogressing;");

	
			//  L  //
			$this->javascript_namespace->header_script_generator->add_method_to_a_class_with_content(
				get_class($this),"load_xml_doc","a_source_tag_name","
		
		var local_prev_req = false;
		if (this.async == undefined){
			this.async=true;
		}
		if (!this.method){
			this.method='GET';
		}
		if (!this.content_type){
			this.content_type = 'text/html';
		}
		
		/*if ((this.async == true) || (this.current_request_index == -1))*/
			var local_req = this.add_new_request(this.params,a_source_tag_name);
		/*else
			var local_req = this.request_list[this.current_request_index];*/
			
		if ((local_req) && (local_req.loading === false))
		{
			try
			{
				var local_param = '';
				if ((local_req.params) && (local_req.params !=''))
				{
					/*if (local_req.params[0] != '&')
						local_param = '&' + local_req.params
					else	
						local_param = '' + local_req.params;*/
                    local_param = 'sid='+".t_cuteengine::javascript_instance_name.".current_session+local_req.params;    
				}
				if (this.async)
				{
					local_req.onreadystatechange= this.on_ready_state;
					local_req.ontimeout= this.on_error.set_scope(this);
					local_req.onerror= this.on_error.set_scope(this);
				}    
				this.on_start_load(local_req);
				this.start_loading(true,local_req);
				
		
				if (this.method == 'GET')
                {
                    local_req.open(this.method,this.url+'?'+local_param,this.async);
					//local_req.setRequestHeader(\"Cookie\", \"PHPSESSID=\"+".t_cuteengine::javascript_instance_name.".current_session+ ';');
                    local_req.send('');
					
                }    
                else
                {
                    local_req.open(this.method,this.url,this.async);
					local_req.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
					//local_req.setRequestHeader('enctype', 'multipart/form-data');
					//local_req.setRequestHeader('Content-length', local_param.length);
					//local_req.setRequestHeader('Connection', 'close');
					
					//local_req.setRequestHeader(\"Cookie\", \"PHPSESSID=\"+".t_cuteengine::javascript_instance_name.".current_session+ ';');
                    local_req.send(local_param);
                } 
				if (this.async == false)
					this.on_ready_state(local_req.request_index);	
			}
			catch (err)
			{
				this.exception_error = err;
				this.on_error(local_req.request_index);
			}
		}");
			//  O  //
			$this->javascript_namespace->header_script_generator->add_method_to_a_class_with_content(
				get_class($this),"on_ready_state","a_req_index","
		/*alert('this.req: '+this.req);*/
		var ready = -1;
		var	httpStatus = -1;
		var is_read_ready = true; 
		try
		{
            if (this.request_list == undefined)
                var local_req = this;
            else  
                var local_req = this.request_list[a_req_index];
            var local_content_loader = local_req.content_loader;  
            ready=local_req.readyState;
			local_res = (local_req.responseText);
           /* httpStatus=local_req.status;
			alert(ready+' -- ' +httpStatus);*/
		}
		catch (err)
		{
			
			is_read_ready = false;
		}
		/*alert('is_read_ready: ' + is_read_ready + ' - ready: ' + ready );*/
		try
		{
			if (is_read_ready)
			{
				if (ready==local_content_loader.READY_STATE_COMPLETE){
					httpStatus=local_req.status;
					if (httpStatus==200 || httpStatus==0){
						local_content_loader.on_load.call(local_content_loader,local_req);
					}else{
					/*alert('this.on error');*/
						local_content_loader.on_error(local_req.request_index);
					}
				}
				else
				{
					/*alert('onprogressing 1');*/
					local_content_loader.on_progres.call(local_content_loader,local_req);
				}
			}
			else if ((local_req != undefined) && (local_content_loader != undefined) && (ready != -1))
			{
					local_content_loader.on_start_load.call(local_content_loader,local_req);
			}
			else
			{
				/*alert('errore');*/
				//alert('is_read_ready: ' + is_read_ready + ' - ready: ' + ready + ' - err:'+err );
				if (this.owner != ".t_cuteengine::javascript_instance_name.")
				".t_cuteengine::javascript_instance_name.".add_err_log(undefined,'Errore improbabile!');
			}	
        /*alert('fine.');*/	
		}
		catch(e)
		{
			//alert('is_read_ready: ' + is_read_ready + ' - ready: ' + ready+ ' - e:'+e );
			/*alert('errore 11');*/
			if (this.owner != ".t_cuteengine::javascript_instance_name.")
				".t_cuteengine::javascript_instance_name.".add_err_log(e);
		}");
        
			//  R  //
			$this->javascript_namespace->header_script_generator->add_method_to_a_class_with_content(
				get_class($this),"render","objId","
	/*	
		this.html_tag(objId).innerHTML = this.get_str (obj);*/");
        
            $this->javascript_namespace->header_script_generator->add_method_to_a_class_with_content(
                get_class($this),'resend','a_req',"
        try
        {
            if (a_req.loading == true)
				a_req.abort.call(a_req);
            var local_param = '';
            if ((a_req.params) && (a_req.params !=''))
            {
                if (a_req.params.charAt(0) != '&')
                    local_param = '?&' + a_req.params
                else	
                    local_param = '?' + a_req.params;
            }            
			this.on_start_load.call(this,a_req);
            this.start_loading(true,a_req);
            a_req.open(this.method,this.url+local_param,this.async);
            a_req.send('');
            if (this.async == false)
                this.on_ready_state(a_req.request_index);
        }catch (err){
            this.exception_error = err;
            this.on_error(a_req.request_index);
        }");
        
            // S
		
            $this->javascript_namespace->header_script_generator->add_method_to_a_class_with_content(
                get_class($this),'start_loading','a_value,a_req',"
        if ((a_req != undefined) && (a_value != a_req.loading))
        {
            if (a_req.loading == false) 
            { 
                if (! this.main_timer)
                {
                    var local_this = this;
                    this.main_timer = setInterval (
                        function(){
                            if (local_this.cmd_request.length > 0)
                            {
                                var local_cmd = local_this.cmd_request.shift();
                                if (local_cmd.cmd == local_this.CMD_REQ_RELOAD)
								{
                                    var local_req = local_this.request_list[local_cmd.req_index];
									local_this.resend(local_req);
								}	
                            }},
                    200);
                }    
            }
            else
            {
            //   clearInterval(this.main_timer);
            }
            a_req.loading = a_value;    
        }");        
		}
		// public
		public function __construct($a_javascript_namespace,$a_parent_component) 
		{
			$this->javascript_namespace = $a_javascript_namespace;
            $this->parent_component = $a_parent_component;
			$this->create_javascript_initialization_component();
            //
           

			
		}		
        
        public function add_execute_javascript_code($a_js_component_name,$a_parameters_list,
            $a_async,$a_method,$a_content_type,$a_to_write_response_name = null,
			$a_set_as_title_page = false)
        {
		/* 
			Gets  the initialize javascript function of the content loader object with  necessary parameters
		*/
			global $g_ambient_namespace;
			if ($a_set_as_title_page === true)
				$local_set_as_title_page = 'true';
			else
				$local_set_as_title_page = 'false';
			//)
			if ((is_object($a_parameters_list)) && (get_class($a_parameters_list) === t_url_parameters_list)) 
				$local_parameters_list = $a_parameters_list;
			else	
				$local_parameters_list = new t_url_parameters_list(true);
            //
			if ($this->use_disguised_parameters_string === true)
			{
				$local_url = /*$g_ambient_namespace->current_domian.*/$local_parameters_list->compute_disguised_parameters_string();
				$local_param = "";
			}
			else
			{    
				$local_url = $g_ambient_namespace->script_name;//$g_ambient_namespace->current_domian;
				$local_param = $local_parameters_list->compute_http_predefined_variables();
			}
			// component_to_write_response_name
			if (isset($a_to_write_response_name))
				$local_to_write_response_name = $a_to_write_response_name;
			else	
				$local_to_write_response_name = $this->component_to_write_response_name;
			//echo " a_to_write_response_name:  $a_to_write_response_name - local_to_write_response_name: $local_to_write_response_name<br> ";	
			//echo "local_parameters_list->compute_disguised_parameters_string():". $local_parameters_list->compute_disguised_parameters_string()." <br>";
			return "
        $a_js_component_name.initialize(this,'$local_url','$local_param',
			this.log_componet_name,'$local_to_write_response_name',
            $this->onprogressing,$this->onload,
            $this->onerror,$a_async,$a_method,$a_content_type,$this->onstartload,$local_set_as_title_page);            
	    if (local_source_tag == null)
            var local_source_tag = '';
        $a_js_component_name.load_xml_doc(local_source_tag);";
        }
		// G
		public static function compute_result_tag($a_tag,$a_value)
		{
			return self::start_result_tag . "$a_tag" . self::end_result_tag . $a_value . 
				self::start_result_tag . "/$a_tag" . self::end_result_tag;
		}
        // I
        public function initialize_parameter($a_component_to_log,
            $a_component_to_write_response_name,$a_onprogressing,$a_onload,
            $a_onerror,$a_onstartload,$a_use_disguised_parameters_string)
        {
			//echo "a_component_to_log: $a_component_to_log<br>";
            $this->component_to_log = $component_to_log;
            $this->component_to_write_response_name = $a_component_to_write_response_name;
            $this->onprogressing = $a_onprogressing;
            $this->onload = $a_onload;
            $this->onerror = $a_onerror;
            $this->onstartload = $a_onstartload;
			$this->use_disguised_parameters_string = $a_use_disguised_parameters_string;
        }    
	}
	
?>